<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html" charset="gb2312">
<title>CoolMeeting会议管理系统</title>
<link rel="stylesheet" href="styles/common.css" />
<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
function turnPage(currentPage){
    $('input[name=currentpage]').val(currentPage);
   
    $('form').submit(); 
 }
</script>
</head>
<body>
	<div class="page-header">
		<div class="header-banner">
			<img src="images/header.png" alt="CoolMeeting" />
		</div>
		<div class="header-title">欢迎访问Cool-Meeting会议管理系统</div>
		<div class="header-quicklink">
			欢迎您，<strong>${emp.employeename }</strong> <a href="changepassword.html">[修改密码]</a>
		</div>
	</div>
	<div class="page-body">
		<div class="page-sidebar">
			<div class="sidebar-menugroup">
				<div class="sidebar-grouptitle">个人中心</div>
				<ul class="sidebar-menu">
					<li class="sidebar-menuitem"><a href="notifications.jsp">最新通知</a></li>
					<li class="sidebar-menuitem active"><a href="myOrderMeeting">我的预定</a></li>
					<li class="sidebar-menuitem"><a href="mymeetings.html">我的会议</a></li>
				</ul>
			</div>
			<div class="sidebar-menugroup">
				<div class="sidebar-grouptitle">人员管理</div>
				<ul class="sidebar-menu">
					<li class="sidebar-menuitem"><a href="selectAllDepts">部门管理</a></li>
					<li class="sidebar-menuitem"><a href="register.jsp">员工注册</a></li>
					<li class="sidebar-menuitem"><a href="selectApproveAccount">注册审批</a></li>
					<li class="sidebar-menuitem"><a
						href="searchEmployees?employeestatus=1">搜索员工</a></li>
				</ul>
			</div>
			<div class="sidebar-menugroup">
				<div class="sidebar-grouptitle">会议预定</div>
				<ul class="sidebar-menu">
					<li class="sidebar-menuitem"><a href="addmeetingroom.jsp">添加会议室</a></li>
					<li class="sidebar-menuitem"><a href="selectMeetingRoom">查看会议室</a></li>
					<li class="sidebar-menuitem"><a href="bookmeeting.jsp">预定会议</a></li>
					<li class="sidebar-menuitem"><a href="selectMeetingPage">搜索会议</a></li>
				</ul>
			</div>
		</div>
		<div class="page-content">
			<div class="content-nav">会议预定 > 搜索会议</div>
			<form action="selectMeetingPage" method="get">
				<fieldset>
					<legend>搜索会议</legend>
					<table class="formtable">
						<tr>
							<td>会议名称：</td>
							<td><input type="text" name="meetingname" maxlength="20"
								value="${param.meetingname }" /></td>
							<td>会议室名称：</td>
							<td><input type="text" name="meetingroom.roomname"
								maxlength="20" value="${param.meetingroom.roomname }" /></td>

							<td>预定者姓名：</td>
							<td><input type="text" name="employee.employeename"
								value="${param.employee.employeename }"></td>
						</tr>
						<tr>
							<td>预定日期：</td>
							<td colspan="5">从&nbsp;<input type="date"
								name="reservationtime" value="${param.reservationtime }"
								placeholder="例如：2013-10-20" /> 到&nbsp;<input type="date"
								id="reservetodate" placeholder="例如：2013-10-22"
								name="reservationtime2" value="${param.reservationtime2 }" />
							</td>
						</tr>
						<tr>
							<td>会议日期：</td>
							<td colspan="5">从&nbsp;<input type="date" name="begintime"
								value='${param.begintime }' placeholder="例如：2013-10-20" />
								到&nbsp;<input type="date" id="meetingtodate"
								placeholder="例如：2013-10-22" name="begintime2"
								value='${param.begintime2 }' /> <input type="hidden"
								name="currentpage" value="${page.currentPage }">
							</td>
						</tr>
						<tr>
							<td colspan="6" class="command"><input type="submit"
								class="clickbutton" value="查询" /> <input type="reset"
								class="clickbutton" value="重置" /></td>
						</tr>
					</table>
				</fieldset>
			</form>
			<div>
				<h3 style="text-align: center; color: black">查询结果</h3>
				<div class="pager-header">
					<div class="header-info">
						共<span class="info-number">${page.recordCount }</span>条结果， 分成<span
							class="info-number">${page.pageCount }</span>页显示， 当前第<span
							class="info-number">${page.currentPage }</span>页
					</div>
					<div class="header-nav">
						<input type="button" onclick="turnPage(1)" class="clickbutton"
							value="首页" /> <input type="button"
							onclick="turnPage(${page.currentPage -1 })" class="clickbutton"
							value="上页" /> <input type="button"
							onclick="turnPage(${page.currentPage +1 })" class="clickbutton"
							value="下页" /> <input type="button"
							onclick="turnPage(${page.pageCount })" class="clickbutton"
							value="末页" /> 跳到第<input type="text" id="pagenum"
							class="nav-number" />页 <input type="button" class="clickbutton"
							value="跳转"
							onclick="turnPage(document.getElementById('pagenum').value)" />
					</div>
				</div>
			</div>
			<table class="listtable">
				<tr class="listheader">
					<th>会议名称</th>
					<th>会议室名称</th>
					<th>会议开始时间</th>
					<th>会议结束时间</th>
					<th>会议预定时间</th>
					<th>预定者</th>
					<th>操作</th>
				</tr>
				<c:if test="${! empty meetings }">
					<c:forEach items="${meetings }" var="meeting">
						<tr>
							<td>${meeting.meetingname }</td>
							<td>${meeting.meetingroom.roomname }</td>
							<td><fmt:formatDate value="${meeting.begintime }"
									pattern="yyyy-MM-dd" type="date" /></td>
							<td><fmt:formatDate value="${meeting.endtime }"
									pattern="yyyy-MM-dd" type="date" /></td>
							<td><fmt:formatDate value="${meeting.reservationtime }"
									pattern="yyyy-MM-dd" type="date" /></td>
							<td>${meeting.employee.employeename }</td>
							<td><a class="clickbutton"
								href="meetingdetails?meetingid=${meeting.meetingid }">查看详情</a></td>
						</tr>
					</c:forEach>
				</c:if>
			</table>
		</div>
	</div>
	<div class="page-footer">
		<hr />
		更多问题，欢迎联系<a href="mailto:webmaster@eeg.com">管理员</a> <img
			src="images/footer.png" alt="CoolMeeting" />
	</div>
</body>
</html>